package com.huilang.demo1;

import javax.swing.*;

public class MenuItem extends MenuComponent{
    public MenuItem(String name, Integer level) {
        this.name = name;
        this.level=level;
    }

    @Override
    public void print() {
        for (int i = 0; i < level; i++) {
            System.out.print("--");
        }
        System.out.println(name);
    }
}
